{template 'common/header'}
<title>个人中心</title>
<style type="text/css">
    body {margin:0px; background:#eee; -moz-appearance:none;}
    a {text-decoration:none;}
    .header {height: auto; width:100%; padding:0px; background: url(../addons/ewei_shop/template/mobile/default/static/images/bg2.png) 0 0 no-repeat;background-size: 100% 100%;}
    .header .user {height:48px; padding:10px;}
    .header .user .user-head {height:48px; width:48px; background:#fff; border-radius:50%; float:left;border:2px solid #fff;}
    .header .user .user-head img {height:48px; width:48px; border-radius:24px;}
    .header .user .user-info {height:48px; width:auto; float:left; margin-left:14px; color:#fff;padding-top:5px;}
    .header .user .user-info .user-name {height:24px; width:auto; font-size:16px; line-height:24px;}
    .header .user .user-info .user-other {height:24px; width:auto; font-size:12px;}
    .header .user-gold {height:35px; width:94%; padding:5px 3%; border-bottom:1px solid #ddd; background:#fff; font-size:16px; line-height:35px;}
    .header .user-gold .title {height:35px; width:auto; float:left; color:#666;}
    .header .user-gold .num {height:35px; width:auto; float:left; color:#f90;}

    .header .user-gold .draw {width:80px; height:30px; background:#6c9; float:right;}
    .header .user .set {height:26px; width:26px; float:right; margin-top:10px;}

    .header .user-op { height:35px; width:94%; padding:5px 3%; border-bottom:1px solid #ddd; background:#fff; font-size:16px; line-height:35px; }
    .take {height:30px; width:auto; padding:0 10px; line-height:30px; font-size:16px; float:right; background:#ff6600; border-radius:5px; margin-top:5px; color:#fff;}
    .take1 {height:30px; width:auto; padding:0 10px; line-height:30px; font-size:16px; float:right; background:#00cc00; border-radius:5px; margin-top:5px; color:#fff;}

    .order {height:135px; width:100%; background:#fff; margin-top:20px; border-bottom:1px solid #ddd;}
    .order_dong {height:135px; width:100%; background:#fff; border-bottom:1px solid #ddd;}

    .order_all {height:100px; width:100%; padding:16px 0px; color:#666;}
    .order_pub {height:18px; float:left; border-left:1px solid #eee; padding-top:5px; text-align:center; color:#666; position:relative;}
    .order_pub span {height:16px; width:16px; background:#f30; border-radius:8px; position:absolute; top:0; right:25%; font-size:12px; color:#fff; line-height:16px;}
    .order_1 {width:24%;}
    .order_2 {width:25%;}
    .order_3 {width:25%;}
    .order_4 {width:25%;}

    .list1 {height:44px; width:94%; background:#fff; padding:0px 3%; margin-top:20px; border-bottom:1px solid #ddd; border-top:1px solid #ddd; line-height:44px; color:#666;}
    .list2 {height:44px; width:94%; background:#fff; padding:0px 3%; border-bottom:1px solid #ddd; border-top:1px solid #ddd; line-height:44px; color:#666;}

    .list1 i {font-size:20px; margin-right:10px;}
    .allorder {float:right; color:#aaa; margin-right:45px; text-decoration:none;}


    .cart {height:auto; width:100%; background:#fff; border-bottom:1px solid #ddd;}
    .commission {position:relative;height:auto; width:100%; background:#fff; margin-top:20px;border-bottom:1px solid #ddd;}
    .commission .list1 span {height:16px; width:16px; background:#f30; border-radius:8px; position:absolute; top:5px; left:30%; font-size:12px; text-align:center;color:#fff; line-height:16px;}

    .address {height:38px; width:100%; background:#fff; margin-top:20px; border-bottom:1px solid #ddd; border-top:1px solid #ddd; line-height:38px;}

    .copyright {height:40px; width:100%; text-align:center; line-height:40px; font-size:12px; color:#999; margin-top:10px;}

</style>

<div id="container"></div>
<script id="member_center" type="text/html">
    <div class="header">
        <div class="user">
            <div class="user-head"><img src="<%member.avatar%>" /></div>
            <div class="user-info">
                <div class="user-name"><%member.nickname%></div>
                <div class="user-other" {if !empty($set['shop']['levelurl'])}onclick='location.href="{$set['shop']['levelurl']}"'{/if}>[<%level.levelname%>] {if !empty($set['shop']['levelurl'])}<i class='fa fa-question-circle' ></i>{/if}
                </div>
            </div>
            <div class="set" onclick='location.href = "{php echo $this->createMobileUrl('member/info')}"'><i class="fa fa-gear" style="font-size:26px; color:#fff;"></i></div>
        </div>

    </div>
    <%if member.dongyu != 1 || member.dongji != 1%>
    <div class="cart">
        <%if member.dongyu != 1%>
        <a href="javascript:;"><div class="list2" style=" border-bottom:0px;border-top:0px;">余额: <span style='color:#f90'><%member.credit2%></span> 
                <!-- <div class="take" onclick="location.href='{php echo $this->createMobileUrl('member/recharge',array('openid'=>$openid))}'">充值</div> --></div></a>
        <%/if%>
        {if $gift_card['gift_card']>0}
        <a href="javascript:;"><div class="list2" style=" border-bottom:0px;border-top:0px;">礼品: <span style='color:#f90'>{$gift_card['gift_card']}</span></div></a>
        {/if}
        <a href="javascript:;">
            <div class="list2" style="margin:0px; border-bottom:0px;">金币: {$gift_card['gold_card']}
                <div class="take1" onclick="location.href = '{php echo $this->createPluginMobileUrl('goldshop/lists')}'">金币兑换</div>
            </div>
        </a>
        <%if member.dongji != 1%>
        <a href="javascript:;"><div class="list2" style="margin:0px; border-bottom:0px;">积分: <%member.credit1%>
                <%if open_creditshop%>
                <div class="take1" onclick="location.href = '{php echo $this->createPluginMobileUrl('creditshop/lists')}'">积分兑换</div>
                <%/if%>
            </div></a>
        <%/if%>
    </div>
    <div class="order">
        <%else%>
        <div class="order_dong">
            <%/if%>
            <a href="{php echo $this->createMobileUrl('order')}">
                <div class="list1" style="margin-top:0px;">
                    <i class="fa fa-reorder" style="float:left; line-height:44px;"></i>
                    <span style="float:left;">我的订单</span>
                    <i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i>
                    <div class="allorder">查看我的全部订单</div>
                </div>
            </a>
            <div class="order_all">
                <a href="{php echo $this->createMobileUrl('order',array('status'=>0))}"><div class="order_pub order_1" style="border:0px;"><i class="fa fa-credit-card" style="font-size:30px"></i><br>待付款<%if order.status0>0%><span><%order.status0%></span><%/if%></div></a>
                <a href="{php echo $this->createMobileUrl('order',array('status'=>1))}"><div class="order_pub order_2"><i class="fa fa-suitcase" style="font-size:30px"></i><br>待发货<%if order.status1>0%><span><%order.status1%></span><%/if%></div></a>
                <a href="{php echo $this->createMobileUrl('order',array('status'=>2))}"><div class="order_pub order_3"><i class="fa fa-truck" style="font-size:30px"></i><br>待收货<%if order.status2>0%><span><%order.status2%></span><%/if%></div></a>
                <a href="{php echo $this->createMobileUrl('order',array('status'=>4))}"><div class="order_pub order_4"><i class="fa fa-money" style="font-size:30px"></i><br>待退款<%if order.status4>0%><span><%order.status4%></span><%/if%></div></a>
            </div>
        </div>
        {if $isagent == 1}
        <div class="commission">
            <a href="{php echo $this->createPluginMobileUrl('commission')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-sitemap" style="color:#99C;"></i>分销中心{if $confirm_num>0}<span>{$confirm_num}</span>{/if}<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
        </div>
        {/if}

        <%if member.dongquan != 1%>
        <div class="commission">

            <!--<a href="{php echo url('activity/coupon/mine');}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-money" style="color:#f90;"></i>我的折扣券<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>-->
            <a href="{php echo url('activity/token/mine');}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-money" style="color:#f03;"></i>我的代金券<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <a href="{php echo url('activity/experience/mine');}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-money" style="color:#f03;"></i>我的体验券<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <a href="{php echo url('activity/goods/mine');}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-money" style="color:#f03;"></i>我的真实物品<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
        </div>
        <%/if%>
        <div class="commission">
            {if $limit_goods}<a href="http://wx.lanxuevip.com/app/index.php?i=5&c=entry&do=index&m=feng_limittime"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-star" style="color:#FF0033;"></i>限时抢购<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>{/if}
            {if $tg_goods}<!-- <a href="http://wx.lanxuevip.com/app/index.php?i=5&c=entry&do=index&m=feng_fightgroups"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-star" style="color:#f90;"></i>我的拼团<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a> -->{/if}
            {if $lottery_goods}<a href="http://wx.lanxuevip.com/app/index.php?i=5&c=entry&do=index&m=feng_lottery"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-star" style="color:#2B8C3C;"></i>拼团抽奖<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>{/if}
            {if $tuangou_goods}<a href="http://wx.lanxuevip.com/app/index.php?i=5&c=entry&do=index&m=tuangou"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-star" style="color:#9A8AED;"></i>超级团购<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>{/if}
            <!--<a href="{php echo $this->createMobileUrl('shop/cart')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-shopping-cart" style="color:#f90;"></i>我的购物车<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>-->
            <a href="{php echo $this->createMobileUrl('shop/favorite')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-heart" style="color:#f03;"></i>我的收藏<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <a href="{php echo $this->createMobileUrl('shop/history')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-list" style="color:#096;"></i>我的足迹<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <a href="{php echo $this->createMobileUrl('member/notice')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-volume-up" style="color:#cc6;"></i>消息提醒设置<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <a href="{php echo $this->createMobileUrl('shop/notice')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-bell" style="color:#cc6;"></i>公告管理<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            <!-- 资格申请 -->
            <!--<a href="{php echo $this->createMobileUrl('member/seniority')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-bell" style="color:#cc6;"></i>拼团资格申请<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>-->

            {if empty($member['isShop'])}
            <a href="{php echo $this->createMobileUrl('shop/apply')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-bell" style="color:#cc6;"></i>小店申请入口<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            {/if}
            {if $member['id']==5158 || $member['id']==5600 || $member['id']==45 || $member['id']==103  || $member['id']==5155 || $member['id']==6049 || $member['id']==1120 || $member['id']==2153 || $member['id']==233}
            <a href="{php echo $this->createMobileUrl('franchise/list')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-list-ul" style="color:#cc6;"></i>加盟入口<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            {/if}
            {if $member['id']==5158 || $member['id']==5600 || $member['id']==45 || $member['id']==103 || $member['id']==5155 || $member['id']==6049 || $member['id']==1120  || $member['id']==2153 || $member['id']==233}
            <a href="{php echo $this->createMobileUrl('franchise/center')}"><div class="list1" style="margin:0px; border-bottom:0px;"><i class="fa fa-list-ul" style="color:#FF9900;"></i>加盟中心<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
            {/if}
        </div>
        {if isset($set['trade']) && $set['trade']['withdraw']==1}
        <a href="javascript:;" id="btnwithdraw"><div class="list1" style="border-bottom: 0px;"><i class="fa fa-money" style="color:#0096ff;"></i>余额提现<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>    
        {/if}
        <a href="{php echo $this->createMobileUrl('member/log')}"><div class="list1" style="{if isset($set['trade']) && $set['trade']['withdraw']==1}margin:0px;{/if}"><i class="fa fa-file-text" style="color:#009;"></i>
                {if isset($set['trade']) && $set['trade']['withdraw']==1}余额明细{else}充值记录{/if}
                <i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
        {if $gift_card['gift_card']>0}
        <a href="{php echo $this->createMobileUrl('member/gift_log')}"><div class="list1" style="margin:0px;"><i class="fa fa-gift" style="color:#009;"></i>
                礼品明细
                <i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>
        {/if}
        <a href="{php echo $this->createMobileUrl('shop/address')}"><div class="list1"><i class="fa fa-street-view" style="color:#99C"></i>收货地址管理<i class="fa fa-angle-right" style="color:#999; font-size:26px; float:right; line-height:44px;"></i></div></a>

        <div class="copyright">版权所有 ©{if empty($set['shop']['name'])}{$_W['account']['name']}{else}{$set['shop']['name']}{/if} </div>
    </script>
    <script language="javascript">
                require(['tpl', 'core'], function(tpl, core) {

                core.json('member/center', {}, function(json){

                $('#container').html(tpl('member_center', json.result));
                        var withdrawmoney = {php echo empty($set['trade']['withdrawmoney'])?0:floatval($set['trade']['withdrawmoney'])};
                        $('#btnwithdraw').click(function(){

                if (json.result.member.credit2 <= 0){
                core.tip.show('无余额可提!');
                        return;
                }
                if (withdrawmoney > 0 && json.result.member.credit2 < withdrawmoney){
                core.tip.show('满' + withdrawmoney + "元才能提现!");
                        return;
                }
                location.href = core.getUrl('member/withdraw');
                })

                }, true);
                })
    </script>
    {php $show_footer=true}
    {php $footer_current='member'}
    {template 'common/footer'}